{{ if .IsEdit}}
{{addToMap . "ContentTitle" .Project.Title}}
{{else}}
{{addToMap . "ContentTitle" "新增项目"}}
{{end}}

<div class="alert alert-danger alert-dismissable hide" id="formErrAlarm">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <h4><i class="icon fa fa-ban"></i> 数据填写错误</h4>
    请根据提示完善数据信息。
</div>
<div class="box box-info">
    <div class="box-header with-border">
      <h3 class="box-title">项目信息</h3>
    </div><!-- /.box-header -->
    <!-- form start -->
    <form class="form-horizontal" method="POST">
      <div class="box-body">
        <div class="form-group">
          <label for="project-title" class="col-sm-4 control-label">项目名称</label>
          <div class="col-sm-4">
            <input type="text" class="form-control" name="Title" id="project-title" value="{{.PostProjectMap.Title}}" placeholder="项目名称">
          </div>
        </div>
        <div class="form-group">
          <label for="project-desc" class="col-sm-4 control-label">描述信息</label>
          <div class="col-sm-4">
            <input type="text" class="form-control" name="Desc" id="project-desc" value="{{.PostProjectMap.Desc}}" placeholder="描述信息">
          </div>
        </div>
      </div><!-- /.box-body -->
      <div class="box-footer">
      {{if .IsEdit}}
        <button type="submit" class="btn btn-primary center-block">修改</button>
      {{else}}
        <button type="submit" class="btn btn-primary center-block">提交</button>
      {{end}}
      </div><!-- /.box-footer -->
    </form>
</div>

<script type="text/javascript">
$(function(){
{{if .FormErrs}}
var formErrs = {{.FormErrsJson}};
showFormErrsAndAlarms(formErrs, function(f){
    return $("input[name="+f+"]");
}, function(input, f){
    return input.parent().parent();
});
{{end}}
});
</script>